﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Data.SqlClient;
public class DataBindSQL
    {
        public DataBindSQL()
        {
        }
        //Hàm thực thi và trả về DataTable
        public DataTable TableThongKe()
        {
            DataTable dtb = new DataTable();
            SqlConnection Conn = new SqlConnection(ConfigurationManager.ConnectionStrings["DBTuVanConnectionString"].ConnectionString);
            try
            {
                // Mở kết nối
                Conn.Open();
                DataSet ds = new DataSet();
                SqlCommand cmdUpd = new SqlCommand("spThongKe_Edit", Conn);
                cmdUpd.CommandType = CommandType.StoredProcedure;
                SqlDataAdapter da = new SqlDataAdapter(cmdUpd);
                // Đổ dữ liệu vào DataSet
                da.Fill(ds);
                dtb = ds.Tables[0];
            }
            catch { }
            finally
            {
                if (Conn.State == ConnectionState.Open)
                    Conn.Close();
                Conn.Dispose();
            }
            return dtb;
        }
}
